package com.qx.chat.system.entity;

import com.qx.chat.system.dao.AbstractRepository;
import com.qx.chat.system.dao.UserDaoImpl;
import com.qx.chat.system.util.SpringUtils;

public class RecentContacts {
	private String audienceUserId;
	private String speakerUserId;
	private User audienceUser;
	private User speakerUser;
	private Integer count;

	public String getAudienceUserId() {
		return audienceUserId;
	}

	public void setAudienceUserId(String audienceUserId) {
		this.audienceUserId = audienceUserId;
	}

	public User getAudienceUser() {
		if(this.audienceUser==null){
			AbstractRepository<User> userService = SpringUtils.getBean(UserDaoImpl.class);
			this.audienceUser=userService.findById(this.audienceUserId);
		}
		return audienceUser;
	}

	public void setAudienceUser(User audienceUser) {
		this.audienceUser = audienceUser;
	}

	public String getSpeakerUserId() {
		return speakerUserId;
	}

	public void setSpeakerUserId(String speakerUserId) {
		this.speakerUserId = speakerUserId;
	}

	public User getSpeakerUser() {
		if(this.speakerUser==null){
			AbstractRepository<User> userService = SpringUtils.getBean(UserDaoImpl.class);
			this.speakerUser=userService.findById(this.speakerUserId);
		}
		return speakerUser;
	}

	public void setSpeakerUser(User speakerUser) {
		this.speakerUser = speakerUser;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}
}
